1. Field
The present application relates to systems and methods for reslicing data in a relational database.
2. Description of the Related Art
A relational database can include data in the form of representations, which can refer herein to tables (or “relations”) and indices. A relation is a data structure which consists of a heading and an ordered or unordered set of tuples which share the same type. An index is a copy of one part of a table that can improve the speed of data retrieval operations by ordering the data in that part of the table. Representations can be organized into rows and columns. A database system can include a plurality of nodes, each of which can hold a portion of the data in the database. A node is a physical hardware component, which can include one or more processing elements, memory elements, and/or storage drives. Data in a representation can be stored entirely on one node. Alternatively, the data of a representation can be distributed among a plurality of nodes in sub-tables, which can be referred to as slices and can be spread throughout the plurality of nodes. By distributing data in a relational database across the slices, the scalability, reliability, availability and/or performance of the relational database can be improved.
Rows of data in a first slice can be copied to one or more new slices during database operations such as reslicing, redistribution, replication, failure recovery, node rebalancing, etc. During such operations, the first slice is locked while the data in the first slice is copied in order to preserve consistency between the data in the first slice and the new slices. While the first slice is locked, no data can be written to the first slice, and all processes that attempt to write to the first slice will wait until the data in the first slice is copied and the new slices are brought online. Because the process of copying the data in the first slice can take a significant amount of time, database operations on the first slice can be blocked for a period of time that is unacceptable to the user.
There is a need for improved systems and methods of reslicing data in a relational database system. Additionally, there is a need for improving the availability and performance of database queries while copying data from a slice.